package com.itheima.sc.impl.pms;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.sc.api.pms.ProductAttributeCategoryApi;
import com.itheima.sc.mapper.pms.ProductAttributeCategoryMapper;
import com.itheima.sc.pojo.pms.ProductAttributeCategory;
import org.apache.dubbo.config.annotation.DubboService;

import java.util.List;

@DubboService
public class ProductAttributeCategoryImpl extends ServiceImpl<ProductAttributeCategoryMapper, ProductAttributeCategory> implements ProductAttributeCategoryApi {

    @Override   //分页获取所有商品属性分类
    public List<ProductAttributeCategory> listByPage(Integer pageNum, Integer pageSize) {
        //分页查询
        Page<ProductAttributeCategory> pageInfo = new Page<>(pageNum, pageSize);
        pageInfo = page(pageInfo);
        List<ProductAttributeCategory> categoryList = pageInfo.getRecords();
        return categoryList;
    }
}
